package com.odm.communitymanage.ui.mine.MyPay

import com.chad.library.adapter.base.BaseNodeAdapter
import com.chad.library.adapter.base.entity.node.BaseNode
import com.odm.communitymanage.core.bean.MonthExpense
import com.odm.communitymanage.core.bean.TypeExpense

/**
 * @description: 我的支付列表适配器
 * @author: ODM
 * @date: 2020/4/20
 */
class MyPayAdapter  : BaseNodeAdapter() {

    companion object {
        const val EXPAND_COLLAPSE_PAYLOAD = 90
    }

    init {
        addNodeProvider(MonthExpenseAdapter()) //月份列表适配器
        addNodeProvider(TypeExpenseAdapter()) //月份下各费用列表适配器
    }

    override fun getItemType(data: List<BaseNode>, position: Int): Int {
        val node : BaseNode?= data[position]
        if(node is MonthExpense){
            return 1
        } else if(node is TypeExpense){
            return 2
        }
        return -1
    }
}